﻿//---------------------------------------------------------------------------

#ifndef logH
#define logH
//---------------------------------------------------------------------------

#include "common.h"
//---------------------------------------------------------------------------

//日志记录类
class TLog
{
private:
	bool FInit;
	char FFile[128];
	int Year, Month, Day;
	TLock ALock;

	void Lock();
	void Unlock();
	void Initialize();
	void SetLogFile();
	void Write(char *pBuffer, int iSize);
	void DelLogs();

	friend void LogInit();
protected:

public:
	TLog();

	void Write(const char *pzOut);
};
//---------------------------------------------------------------------------

extern void LogInit();
extern void LogOut(const char *pzInfo);
extern void LogOut(const char *pzHdr, BYTE *pData, int uSize);
//---------------------------------------------------------------------------

#endif
